﻿using System.Collections.Generic;
using System.Data;
using PPI.Entities.Lookup;
using VMind.Global;

namespace PPI.Client.Logic.Distribution
{
    public class LTreatment
    {
        public static List<EXMissionStructures_PoleTreatment> SelectAllIdName()
        {
            DataTable dt = WebConsumer.Distribution.WDistributionTreatment.SelectAllIdName().Tables[0];
            List<EXMissionStructures_PoleTreatment> lstTreatments = new List<EXMissionStructures_PoleTreatment>();

            foreach (DataRow drTreatment in dt.Rows)
            {
                EXMissionStructures_PoleTreatment treatment = new EXMissionStructures_PoleTreatment();

                treatment.Id = ConvertHelper.ToInt32(drTreatment["XMissionStructures_PoleTreatmentId"]);
                treatment.Name = drTreatment["Name"].ToString();

                lstTreatments.Add(treatment);
            }

            return lstTreatments;
        }
    }
}
